home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tk8.0 / win / makefile.vc < prev    next >
Encoding:
Makefile  |  1997-08-15  |  10.4 KB  |  398 lines  |  [TEXT/ALFA]

  1. # Visual C++ 2.x and 4.0 makefile
  2. #
  3. # See the file "license.terms" for information on usage and redistribution
  4. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  5. # Copyright (c) 1995-1996 Sun Microsystems, Inc.
  6. # SCCS: @(#) makefile.vc 1.63 97/08/13 13:33:32
  7.  
  8. # Does not depend on the presence of any environment variables in
  9. # order to compile tcl; all needed information is derived from 
  10. # location of the compiler directories.
  11.  
  12. #
  13. # Project directories
  14. #
  15. # ROOT    = top of source tree
  16. #
  17. # TMPDIR  = location where .obj files should be stored during build
  18. #
  19. # TOOLS32 = location of VC++ 32-bit development tools. Note that the
  20. #        VC++ 2.0 header files are broken, so you need to use the
  21. #        ones that come with the developer network CD's, or later
  22. #        versions of VC++.
  23. #
  24. # TCLDIR = location of top of Tcl source heirarchy
  25. #
  26.  
  27. ROOT    = ..
  28. TMPDIR    = .
  29. TOOLS32    = c:\msdev
  30. TCLDIR    = ..\..\tcl8.0
  31.  
  32. # Set this to the appropriate value of /MACHINE: for your platform
  33. MACHINE    = IX86
  34.  
  35. # Comment the following line to compile with symbols
  36. NODEBUG=1
  37.  
  38. # uncomment the following two lines to compile with TCL_MEM_DEBUG
  39. #DEBUGDEFINES    =-DTCL_MEM_DEBUG
  40.  
  41. ######################################################################
  42. # Do not modify below this line
  43. ######################################################################
  44.  
  45. VERSION = 80
  46.  
  47. TCLDLL = tcl$(VERSION).dll
  48. TCLLIB = tcl$(VERSION).lib
  49. TCLPLUGINDLL = tcl$(VERSION)p.dll
  50. TCLPLUGINLIB = tcl$(VERSION)p.lib
  51. TKDLL = tk$(VERSION).dll
  52. TKLIB = tk$(VERSION).lib
  53. TKPLUGINDLL = tk$(VERSION)p.dll
  54. TKPLUGINLIB = tk$(VERSION)p.lib
  55.  
  56. WISH = wish$(VERSION).exe
  57. WISHP = wishp$(VERSION).exe
  58. TKTEST = tktest.exe
  59. DUMPEXTS = $(TMPDIR)\dumpexts.exe
  60.  
  61. WISHOBJS = \
  62.     $(TMPDIR)\tkConsole.obj \
  63.     $(TMPDIR)\winMain.obj
  64.  
  65. TKTESTOBJS = \
  66.     $(TMPDIR)\tkConsole.obj \
  67.     $(TMPDIR)\tkTest.obj \
  68.     $(TMPDIR)\tkSquare.obj \
  69.     $(TMPDIR)\testMain.obj
  70.  
  71. XLIBOBJS = \
  72.     $(TMPDIR)\xcolors.obj \
  73.     $(TMPDIR)\xdraw.obj \
  74.     $(TMPDIR)\xgc.obj \
  75.     $(TMPDIR)\ximage.obj \
  76.     $(TMPDIR)\xutil.obj
  77.  
  78. TKOBJS = \
  79.     $(TMPDIR)\tkUnixMenubu.obj \
  80.     $(TMPDIR)\tkUnixScale.obj \
  81.     $(XLIBOBJS) \
  82.     $(TMPDIR)\tkWin3d.obj \
  83.     $(TMPDIR)\tkWin32Dll.obj \
  84.     $(TMPDIR)\tkWinButton.obj \
  85.     $(TMPDIR)\tkWinClipboard.obj \
  86.     $(TMPDIR)\tkWinColor.obj \
  87.     $(TMPDIR)\tkWinCursor.obj \
  88.     $(TMPDIR)\tkWinDialog.obj \
  89.     $(TMPDIR)\tkWinDraw.obj \
  90.     $(TMPDIR)\tkWinEmbed.obj \
  91.     $(TMPDIR)\tkWinFont.obj \
  92.     $(TMPDIR)\tkWinImage.obj \
  93.     $(TMPDIR)\tkWinInit.obj \
  94.     $(TMPDIR)\tkWinKey.obj \
  95.     $(TMPDIR)\tkWinMenu.obj \
  96.     $(TMPDIR)\tkWinPixmap.obj \
  97.     $(TMPDIR)\tkWinPointer.obj \
  98.     $(TMPDIR)\tkWinRegion.obj \
  99.     $(TMPDIR)\tkWinScrlbr.obj \
  100.     $(TMPDIR)\tkWinSend.obj \
  101.     $(TMPDIR)\tkWinWindow.obj \
  102.     $(TMPDIR)\tkWinWm.obj \
  103.     $(TMPDIR)\tkWinX.obj \
  104.     $(TMPDIR)\stubs.obj \
  105.     $(TMPDIR)\tk3d.obj \
  106.     $(TMPDIR)\tkArgv.obj \
  107.     $(TMPDIR)\tkAtom.obj \
  108.     $(TMPDIR)\tkBind.obj \
  109.     $(TMPDIR)\tkBitmap.obj \
  110.     $(TMPDIR)\tkButton.obj \
  111.     $(TMPDIR)\tkCanvArc.obj \
  112.     $(TMPDIR)\tkCanvBmap.obj \
  113.     $(TMPDIR)\tkCanvImg.obj \
  114.     $(TMPDIR)\tkCanvLine.obj \
  115.     $(TMPDIR)\tkCanvPoly.obj \
  116.     $(TMPDIR)\tkCanvPs.obj \
  117.     $(TMPDIR)\tkCanvText.obj \
  118.     $(TMPDIR)\tkCanvUtil.obj \
  119.     $(TMPDIR)\tkCanvWind.obj \
  120.     $(TMPDIR)\tkCanvas.obj \
  121.     $(TMPDIR)\tkClipboard.obj \
  122.     $(TMPDIR)\tkCmds.obj \
  123.     $(TMPDIR)\tkColor.obj \
  124.     $(TMPDIR)\tkConfig.obj \
  125.     $(TMPDIR)\tkCursor.obj \
  126.     $(TMPDIR)\tkEntry.obj \
  127.     $(TMPDIR)\tkError.obj \
  128.     $(TMPDIR)\tkEvent.obj \
  129.     $(TMPDIR)\tkFileFilter.obj \
  130.     $(TMPDIR)\tkFocus.obj \
  131.     $(TMPDIR)\tkFont.obj \
  132.     $(TMPDIR)\tkFrame.obj \
  133.     $(TMPDIR)\tkGC.obj \
  134.     $(TMPDIR)\tkGeometry.obj \
  135.     $(TMPDIR)\tkGet.obj \
  136.     $(TMPDIR)\tkGrab.obj \
  137.     $(TMPDIR)\tkGrid.obj \
  138.     $(TMPDIR)\tkImage.obj \
  139.     $(TMPDIR)\tkImgBmap.obj \
  140.     $(TMPDIR)\tkImgGIF.obj \
  141.     $(TMPDIR)\tkImgPPM.obj \
  142.     $(TMPDIR)\tkImgPhoto.obj \
  143.     $(TMPDIR)\tkImgUtil.obj \
  144.     $(TMPDIR)\tkListbox.obj \
  145.     $(TMPDIR)\tkMacWinMenu.obj \
  146.     $(TMPDIR)\tkMain.obj \
  147.     $(TMPDIR)\tkMenu.obj \
  148.     $(TMPDIR)\tkMenubutton.obj \
  149.     $(TMPDIR)\tkMenuDraw.obj \
  150.     $(TMPDIR)\tkMessage.obj \
  151.     $(TMPDIR)\tkOption.obj \
  152.     $(TMPDIR)\tkPack.obj \
  153.     $(TMPDIR)\tkPlace.obj \
  154.     $(TMPDIR)\tkPointer.obj \
  155.     $(TMPDIR)\tkRectOval.obj \
  156.     $(TMPDIR)\tkScale.obj \
  157.     $(TMPDIR)\tkScrollbar.obj \
  158.     $(TMPDIR)\tkSelect.obj \
  159.     $(TMPDIR)\tkText.obj \
  160.     $(TMPDIR)\tkTextBTree.obj \
  161.     $(TMPDIR)\tkTextDisp.obj \
  162.     $(TMPDIR)\tkTextImage.obj \
  163.     $(TMPDIR)\tkTextIndex.obj \
  164.     $(TMPDIR)\tkTextMark.obj \
  165.     $(TMPDIR)\tkTextTag.obj \
  166.     $(TMPDIR)\tkTextWind.obj \
  167.     $(TMPDIR)\tkTrig.obj \
  168.     $(TMPDIR)\tkUtil.obj \
  169.     $(TMPDIR)\tkVisual.obj \
  170.     $(TMPDIR)\tkWindow.obj
  171.  
  172. cc32        = $(TOOLS32)\bin\cl.exe
  173. link32        = $(TOOLS32)\bin\link.exe
  174. rc32        = $(TOOLS32)\bin\rc.exe
  175. include32    = -I$(TOOLS32)\include
  176.  
  177. WINDIR          = $(ROOT)\win
  178. GENERICDIR    = $(ROOT)\generic
  179. XLIBDIR        = $(ROOT)\xlib
  180. BITMAPDIR    = $(ROOT)\bitmaps
  181. TCLLIBDIR       = $(TCLDIR)\win
  182. RCDIR        = $(WINDIR)\rc
  183.  
  184. TK_INCLUDES    = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \
  185.             -I$(TCLDIR)\generic
  186. TK_DEFINES    = $(DEBUGDEFINES)
  187.  
  188. TK_CFLAGS    = $(cdebug) $(cflags) $(cvarsdll) $(include32) \
  189.             $(TK_INCLUDES) $(TK_DEFINES) 
  190.  
  191. ######################################################################
  192. # Link flags
  193. ######################################################################
  194.  
  195. !IFDEF NODEBUG
  196. ldebug = /RELEASE
  197. !ELSE
  198. ldebug = -debug:full -debugtype:cv
  199. !ENDIF
  200.  
  201. # declarations common to all linker options
  202. lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
  203.  
  204. # declarations for use on Intel i386, i486, and Pentium systems
  205. !IF "$(MACHINE)" == "IX86"
  206. DLLENTRY = @12
  207. lflags   = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
  208. !ELSE
  209. lflags   = $(lcommon) /MACHINE:$(MACHINE)
  210. !ENDIF
  211.  
  212. conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
  213. guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
  214. dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
  215.  
  216. !IF "$(MACHINE)" == "PPC"
  217. libc = libc.lib
  218. libcdll = crtdll.lib
  219. !ELSE
  220. libc = libc.lib oldnames.lib
  221. libcdll = msvcrt.lib oldnames.lib
  222. !ENDIF
  223.  
  224. baselibs   = kernel32.lib $(optlibs) advapi32.lib
  225. winlibs    = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
  226. guilibs       = $(libc) $(winlibs)
  227.  
  228. guilibsdll = $(libcdll) $(winlibs)
  229.  
  230. ######################################################################
  231. # Compile flags
  232. ######################################################################
  233.  
  234. !IFDEF NODEBUG
  235. cdebug = -Ox
  236. !ELSE
  237. cdebug = -Z7 -Od -WX
  238. !ENDIF
  239.  
  240. # declarations common to all compiler options
  241. ccommon = -c -W3 -nologo -YX
  242.  
  243. !IF "$(MACHINE)" == "IX86"
  244. cflags = $(ccommon) -D_X86_=1
  245. !ELSE
  246. !IF "$(MACHINE)" == "MIPS"
  247. cflags = $(ccommon) -D_MIPS_=1
  248. !ELSE
  249. !IF "$(MACHINE)" == "PPC"
  250. cflags = $(ccommon) -D_PPC_=1
  251. !ELSE
  252. !IF "$(MACHINE)" == "ALPHA"
  253. cflags = $(ccommon) -D_ALPHA_=1
  254. !ENDIF
  255. !ENDIF
  256. !ENDIF
  257. !ENDIF
  258.  
  259. cvars      = -DWIN32 -D_WIN32
  260. cvarsmt    = $(cvars) -D_MT
  261. cvarsdll   = $(cvarsmt) -D_DLL
  262.  
  263. CON_CFLAGS    = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
  264.  
  265. ######################################################################
  266. # Project specific targets
  267. ######################################################################
  268.  
  269. all:    $(WISH)
  270. test:    $(TKTEST)
  271. plugin:    $(TKPLUGINDLL) $(WISHP)
  272.  
  273. $(TKLIB): $(TKDLL)
  274.  
  275. $(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res $(TMPDIR)\tk.def
  276.     set LIB=$(TOOLS32)\lib
  277.         $(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\tk.def \
  278.         -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLLIB) \
  279.         $(guilibsdll) @<<
  280.             $(TKOBJS)
  281. <<
  282.  
  283. $(TKPLUGINLIB): $(TKPLUGINDLL)
  284.  
  285. $(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res $(TMPDIR)\plugin.def
  286.     set LIB=$(TOOLS32)\lib
  287.         $(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\plugin.def \
  288.         -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \
  289.         $(guilibsdll) @<<
  290.             $(TKOBJS)
  291. <<
  292.  
  293. $(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res
  294.     set LIB=$(TOOLS32)\lib
  295.     $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
  296.         $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(WISHOBJS) 
  297.  
  298. $(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res
  299.     set LIB=$(TOOLS32)\lib
  300.     $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
  301.         $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \
  302.         $(TKPLUGINLIB) $(WISHOBJS) 
  303.  
  304. $(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res
  305.     set LIB=$(TOOLS32)\lib
  306.     $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
  307.         $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS)
  308.  
  309. $(TMPDIR)\tk.def: $(DUMPEXTS) $(TKOBJS)
  310.     $(DUMPEXTS) -o $@ $(TKDLL) @<<
  311.         $(TKOBJS)
  312. <<
  313.  
  314. $(TMPDIR)\plugin.def: $(DUMPEXTS) $(TKOBJS)
  315.     $(DUMPEXTS) -o $@ $(TKPLUGINDLL) @<<
  316.         $(TKOBJS)
  317. <<
  318.  
  319. $(DUMPEXTS): $(TCLDIR)\win\winDumpExts.c
  320.     $(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $?
  321.     set LIB=$(TOOLS32)\lib
  322.     $(link32) $(ldebug) $(conlflags) $(guilibs) -out:$@ \
  323.         $(TMPDIR)\winDumpExts.obj 
  324.  
  325. #
  326. # Special case object file targets
  327. #
  328.  
  329. $(TMPDIR)\testMain.obj: $(ROOT)\win\winMain.c
  330.     $(cc32) $(TK_CFLAGS) -DTK_TEST -Fo$@ $?
  331.  
  332. #
  333. # Implicit rules
  334. #
  335.  
  336. {$(XLIBDIR)}.c{$(TMPDIR)}.obj:
  337.     $(cc32) $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  338.  
  339. {$(GENERICDIR)}.c{$(TMPDIR)}.obj:
  340.     $(cc32) $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  341.  
  342. {$(WINDIR)}.c{$(TMPDIR)}.obj:
  343.     $(cc32) $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  344.  
  345. {$(ROOT)\unix}.c{$(TMPDIR)}.obj:
  346.     $(cc32) $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  347.  
  348. {$(RCDIR)}.rc{$(TMPDIR)}.res:
  349.     $(rc32) -fo $@ -r -i $(GENERICDIR) $<
  350.  
  351. clean:
  352.     -@del *.exp
  353.     -@del *.lib
  354.     -@del *.dll
  355.     -@del *.exe
  356.         -@del $(TMPDIR)\*.obj 
  357.         -@del $(TMPDIR)\*.res
  358.         -@del $(TMPDIR)\*.def
  359.  
  360. # dependencies
  361.  
  362. $(TMPDIR)\tk.res: \
  363.     $(RCDIR)\buttons.bmp \
  364.     $(RCDIR)\cursor*.cur \
  365.     $(RCDIR)\tk.ico
  366.  
  367. $(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h
  368. $(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h
  369. $(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h
  370. $(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h
  371. $(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h
  372. $(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h
  373. $(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h
  374. $(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h
  375. $(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h
  376. $(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h
  377. $(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h
  378. $(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h
  379. $(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h
  380. $(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h
  381.  
  382. $(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h
  383. $(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h
  384. $(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
  385. $(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
  386. $(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h
  387. $(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h
  388. $(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h
  389. $(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h
  390. $(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h
  391.  
  392. $(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h
  393. $(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h
  394. $(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h
  395. $(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h
  396.  
  397.